package com.shop2cn.iapi.productcategory.service;

import java.util.List;

import org.json.JSONObject;

import com.google.gson.JsonArray;
import com.google.gson.reflect.TypeToken;
import com.shop2cn.iapi.productcategory.parameter.BrandDto;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.EnvSetup;

public class GetAllBrandCall extends YmatouBaseCall {
	private static String opurl = "api/Brand/GetAllBrand";

	public GetAllBrandCall() {
		super(EnvSetup.getSystemUrl("productcategory_shop2cn"), opurl, "GET", "PARAM");
	}

	/**
	 * @param domain
	 *            EnvSetup.getSystemUrl("productcategory_shop2cn") or
	 *            EnvSetup.getSystemUrl("productcategory_api") 用于新旧站点
	 */
	public GetAllBrandCall(String domain) {
		super(domain, opurl, "GET", "PARAM");
	}

	@Override
	public void addDefHeader() {
		client.addHeader("Accept", "text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}

	public JsonArray getData() {
		return getJsonObject().getAsJsonObject("Data").getAsJsonArray("BrandList");
	}

}
